#include <stdio.h>

#define GetDigitScore(x) ((x)&15)
#define GetXScore(x) (((x)&15)|((x>>6)<<1))

int main(int argc, char *argv[]){
    FILE * f_in = fopen(argv[1], "r");
    char line[50];
    int ans, xnum, i;
    while(fgets(line, 50, f_in)){
        ans = xnum = 0;
        for(i=0;(i>>1)+xnum<=19;i+=2){
            if(line[i]=='X'){
                ans += line[i+4]=='/'?20:10 + GetXScore(line[i+2]) + GetXScore(line[i+4]);
                xnum++;
            }else if(line[i]=='/') ans += 10 - GetDigitScore(line[i-2]) + GetXScore(line[i+2]);
            else ans += GetDigitScore(line[i]);
        }
        printf("%d\n", ans);
    }
    return 0;
}
